home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / lib / tex / textyl / textyl.shar9.Z / textyl.shar9
Encoding:
Text File  |  1987-08-10  |  64.4 KB  |  1,509 lines

  1. #!/bin/sh
  2. # to extract, remove the header and type "sh filename"
  3. if `test ! -s ./README`
  4. then
  5. echo "writing ./README"
  6. cat > ./README << 'E_O_F'
  7.  
  8.  
  9. This is TeXtyl, a post-processor for TeX, which
  10. allows you to typeset graphic line-drawings in
  11. a device-independent manner. It makes use of the \special
  12. facility of TeX to insert commands into the original
  13.  .DVI file produced by TeX, and post-processes that
  14. file, producing another .DVI file for spooling to 
  15. your favorite printer.
  16.  
  17. TeXtyl is written in Pascal because of portability
  18. requirements while under development at Ohio State.  For that
  19. reason, the main portion is one monolithic file, with hooks
  20. into Unix (in a manner similar to that of  "dvitype").  The
  21. original TeXtyl has/had the ability to typeset musical beams.
  22. The enclosed version does not have that ability for reasons of
  23. space and utility. If you feel that you really need it, write
  24. to me at the address below.  Positive suggestions and
  25. ideas for improvements are welcomed, as are actual
  26. improvements to the code.
  27.  
  28. Also included is the TeXtyl manual, describing
  29. how to use TeXtyl. It is a LaTeX document, using
  30. TeXtyl-commands for examples. It is also available
  31. as a technical report from Ohio State University's
  32. Computer & Information Sciences Dept. at
  33. 1036 Neil Avenue, Columbus, OH 43210. 
  34. TR #OSU-CISRC-4/87-TR9.  The current version has the
  35. added flexiblity of patterned lines, which is not
  36. reflected in the OSU report.
  37.  
  38. Finally, in a subsequent posting, are the vector fonts
  39. for actually typesetting the graphic figures. Although
  40. given at a 300dpi resolution, the fonts were created
  41. for device-independence. The file "vecbase.mf" is
  42. included, but has not been translated to the newer
  43. version of Metafont. See the TeXtyl manual for 
  44. implementation details of the vector fonts.
  45.  
  46. This posting comes in several pieces. The directory
  47. stucture currently looks like:
  48. ./TeXtyl
  49. README    doc/       src/       vecfonts/
  50.  
  51. ./TeXtyl/doc:
  52. Makefile  TYLMAN.02 TYLMAN.05 TYLMAN.08 TYLMAN.11
  53. TYLMAN.00 TYLMAN.03 TYLMAN.06 TYLMAN.09 TYLMAN.12
  54. TYLMAN.01 TYLMAN.04 TYLMAN.07 TYLMAN.10 TYLMAN.13
  55. textyl.tex 
  56.  
  57. ./TeXtyl/src:
  58. h00vars.h textyl.pas.aa textyl.pas.ad textyl.pas.ag
  59. makefile  textyl.pas.ab textyl.pas.ae textyl.pas.ah
  60. texpaths.h textyl.pas.ac textyl.pas.af tylext.c tylext.h
  61.  
  62. ./TeXtyl/vecfonts:
  63. vecfonts.shar.aa  vecfonts.shar.ab  
  64. vecfonts.shar.ac  vecfonts.shar.ad 
  65.  
  66.  
  67. NOTICES:
  68. TeXtyl was written by John Renner between 1984-1987
  69. while at the Ohio State University, and elsewhere/when.
  70. These files and the TeXtyl system are Copyright (c) 1987 by
  71. John S. Renner, All rights reserved. You may
  72. freely use this program, as long as you do no
  73. sell it (nor any derivatives of it),
  74. and as long as I receive a copy of all modifications.
  75. This copyright notice must stay intact and accompany
  76. the TeXtyl sources and manual.
  77.  
  78. The program, TeXtyl, and the vector fonts were
  79. derived either independently or from sources noted
  80. in the TeXtyl manual. There is absolutely NO relationship
  81. between this work and the work done by Adobe Systems, Inc.,
  82. as TeXtyl was written entirely and independently by 
  83. John Renner prior to association with that company.
  84.  
  85. Current Address: John Renner
  86.         100 N Whisman #211
  87.         Mountain View, CA 94043
  88.  
  89.   adobe!renner@decwrl.dec.com
  90.  
  91. E_O_F
  92. else
  93.   echo "will not over write ./README"
  94. fi
  95. chmod 644 ./README
  96. if [ `wc -c ./README | awk '{printf $1}'` -ne 3111 ]
  97. then
  98. echo `wc -c ./README | awk '{print "Got " $1 ", Expected " 3111}'`
  99. fi
  100. if `test ! -s ./SUPPLEMENT`
  101. then
  102. echo "writing ./SUPPLEMENT"
  103. cat > ./SUPPLEMENT << 'E_O_F'
  104. Archiver's note
  105.  
  106. This program is known to work on BSD type systems. Ports to WEB, C and
  107. other OSes are encouraged. Remember to send changes to the author
  108. first.
  109.  
  110. I have taken the liberty of making some changes. In three places (twice
  111. in the docs, once in the program) I have changed the fonts from am to
  112. cm. I have edited texpaths.h to be more typical. Installers should use
  113. the same texpaths.h as TeX uses. The fonts are in pk format (more
  114. compact).
  115.  
  116.     Ken
  117.     June 1987
  118.     LaTeX-Style@cs.rochester.edu
  119. E_O_F
  120. else
  121.   echo "will not over write ./SUPPLEMENT"
  122. fi
  123. chmod 644 ./SUPPLEMENT
  124. if [ `wc -c ./SUPPLEMENT | awk '{printf $1}'` -ne 498 ]
  125. then
  126. echo `wc -c ./SUPPLEMENT | awk '{print "Got " $1 ", Expected " 498}'`
  127. fi
  128. if `test ! -d ./doc`
  129. then
  130.   mkdir ./doc
  131.   echo "mkdir ./doc"
  132. fi
  133. if `test ! -s ./doc/Makefile`
  134. then
  135. echo "writing ./doc/Makefile"
  136. cat > ./doc/Makefile << 'E_O_F'
  137. #    Makefile for TeXtyl Manual
  138. LATEX = latex
  139. INCLUDES = TYLMAN.00 \
  140.     TYLMAN.01 \
  141.     TYLMAN.02 \
  142.     TYLMAN.03 \
  143.     TYLMAN.04 \
  144.     TYLMAN.05 \
  145.     TYLMAN.06 \
  146.     TYLMAN.07 \
  147.     TYLMAN.08 \
  148.     TYLMAN.09 \
  149.     TYLMAN.10 \
  150.     TYLMAN.11 \
  151.     TYLMAN.12 \
  152.     TYLMAN.13 
  153.  
  154.  
  155. tylman:    ${INCLUDES} textyl.tex
  156.     cat ${INCLUDES} > tylman.tex
  157.     $(LATEX) tylman.tex
  158.     /bin/rm tylman.tex
  159. E_O_F
  160. else
  161.   echo "will not over write ./doc/Makefile"
  162. fi
  163. chmod 644 ./doc/Makefile
  164. if [ `wc -c ./doc/Makefile | awk '{printf $1}'` -ne 338 ]
  165. then
  166. echo `wc -c ./doc/Makefile | awk '{print "Got " $1 ", Expected " 338}'`
  167. fi
  168. if `test ! -s ./doc/TYLMAN.00`
  169. then
  170. echo "writing ./doc/TYLMAN.00"
  171. cat > ./doc/TYLMAN.00 << 'E_O_F'
  172. %
  173. %    LaTeX file for  the TeXtyl Manual
  174. %    Copyright (c) 1986, 1987  John S. Renner
  175. %
  176.  
  177. \documentstyle[twoside,12pt]{report}
  178. \makeindex
  179. \pagestyle{plain}
  180. \pagenumbering{roman}
  181. \begin{document}
  182. \bibliographystyle{plain}
  183. \hfuzz 5pt 
  184. \vfuzz 3pt
  185. \hoffset 1in
  186. \voffset 1in
  187. \hyphenchar\tentt=-1
  188. % big tt font
  189. \font\btt=cmtt10 scaled \magstep2
  190. \hyphenchar\btt=-1
  191. % font for small caps
  192. \font\smallrm=cmr10
  193.  
  194. % special comma
  195. \def\Coma{$\raise 2.5pt\hbox{\btt ,}$}
  196. % macro for specifying a parameter
  197. \def\Prm#1{\leavevmode \hbox{$\>\langle${\it #1\/}$\rangle\,$}}
  198. % macro for specifying an optional parameter
  199. \def\Opt#1{\leavevmode \hbox{$\>\lbrack\langle${\it #1\/}$\rangle\,
  200. \raise 2.5pt\hbox{\btt ,}\,\rbrack\,$}}
  201. % optional parameter without large comma
  202. \def\sOpt#1{\leavevmode \hbox{$\>\lbrack\langle${\it #1\/}$\rangle\,
  203. \rbrack\,$}}
  204. % used for simple verbatim environment using | | delimiters
  205. %  taken from TeXbook
  206. \chardef\other=12
  207. \def\ttverbatim{\begingroup \catcode`\\=\other \catcode`\{=\other
  208.         \catcode`\}=\other \catcode`\$=\other \catcode`\&=\other
  209.     \catcode`\~=\other \catcode`\%=\other \catcode`\#=\other
  210.     \obeyspaces \obeylines \tt}
  211. {\obeyspaces\gdef {\ }}
  212. \outer\def\begintt{$$\let\par=\endgraf \ttverbatim \parskip=0pt
  213.    catcode`\|=0 \rightskip=-5pc \ttfinish}
  214. {\catcode`\|=0 |catcode`|\=\other
  215.   |obeylines
  216.   |gdef|ttfinish#1^^M#2\endtt{#1|vbox{#2}|endgroup$$}}
  217. \catcode`\|=\active
  218. {\obeylines\gdef|{\ttverbatim\spaceskip=.5em plus .25em minus .15em\let^^M=\  \let|=\endgroup}}
  219. %
  220. % macro for figures for Tyling
  221. \input{textyl}
  222.  
  223. \newcommand{\TT}{{\it\TeX tyl\/} }
  224. \newcommand{\TTN}{{\it\TeX tyl}}
  225. \newcommand{\DVI}{{\smallrm DVI}}
  226. \newcommand{\Makeodd}{{\ifodd\count0{\newpage\mbox{\  }\newpage}\fi}}
  227.  
  228. \title{\TeX tyl: a line-drawing interface for \TeX}
  229. \author{John S. Renner}
  230. \date{14 March 1987
  231. \thanks{Copyright \copyright 1987~John~S.~Renner All rights reserved.}}
  232. \maketitle
  233. \clearpage %end page 0
  234. \begin{verse}
  235. \it Geometry can produce legible letters,\\
  236.  but art alone makes them beautiful.\\
  237. \end{verse}\par
  238. \noindent\begintyl{260 pt}[1in]
  239. \special{tyl beginfigure "zapf"}
  240. \special{tyl line m 2 1,92; 45,92}
  241. \special{tyl line m 2 1,92; 1,48}
  242. \special{tyl line m 2 1,48; 111,48}
  243. \special{tyl line m 2 45,92; 45,4}
  244. \special{tyl line m 2 12,48; 12,92}
  245. \special{tyl line m 2 23,48; 23,92}
  246. \special{tyl line m 2 34,48;34,92}
  247. \special{tyl line m 2 1,70;45,70}
  248. \special{tyl line m 2 1,92; 23,48}
  249. \special{tyl line m 2 1,92; 89,4}
  250. \special{tyl line m 2 23,92;1,70}
  251. \special{tyl line m 2 23,92;1,48}
  252. \special{tyl line m 2 23,92; 45,48}
  253. \special{tyl line m 2 45,92;1,48}
  254. \special{tyl line m 2 45,92; 23,48}
  255. \special{tyl line m 2 1,70,23,48}
  256. \special{tyl arc m 2 11 @ 12,81 270,90}
  257. \special{tyl arc m 2 11 @ 34,81 10 10}
  258. \special{tyl arc m 2 11 @ 34,59 10 10}
  259. \special{tyl arc m 2 11 @ 12,59 270 90}
  260. \special{tyl arc m 2 22 @ 23,70 10 10}
  261.  
  262. \special{tyl line m 2 45,92; 111,26}
  263. \special{tyl line m 2 1,48; 45,4}
  264. \special{tyl line m 2 45,4;100,60}
  265. \special{tyl arc m 2 32 @ 45,48 10 10}
  266. \special{tyl line m 2 45,4; 89,4}
  267. \special{tyl line m 2 89,4; 89,60}
  268. \special{tyl line m 2 89,4 111 26}
  269. \special{tyl arc m 2 22  @ 67,26 10 10}
  270. \special{tyl line m 2 67 26; 111 26}
  271. \special{tyl arc m 2 16 @ 89,26 10 10}
  272. \special{tyl line m 2 89,26; 111,48}
  273. \special{tyl arc m 2 11 @ 100,37 10 10}
  274. \special{tyl line m 2 100,37;100,60}
  275. \special{tyl line m 2 111,26;111,48}
  276. \special{tyl line m 2 111,48; 100,60}
  277. \special{tyl arc m 2 8 @ 100 48 10 10}
  278. \special{tyl arc m 2 6 @ 94 54 10 10}
  279. \special{tyl line m 2 89,60; 100 48}
  280. \special{tyl line m 2 95,54; 83 54}
  281. \special{tyl arc m 2 4 @ 89 54 10 10}
  282. \special{tyl line m 2 89 54; 100 54}
  283. \special{tyl line m 2 89,60;83,54}
  284. \special{tyl line m 2 89, 60; 100 60}
  285. \special{tyl line m 2 83,54; 83,48}
  286. \special{tyl line m 2 84,48; 89,54}
  287. \special{tyl arc m 2 3 @ 86 51 10 10}
  288. \special{tyl endfigure "zapf"}
  289. \endtyl
  290. \par
  291. \nobreak
  292. \begin{verse}
  293. \it Art begins where geometry ends,\\*
  294. and imparts to letters a character\\*
  295. transcending mere measurement.\\*
  296. \hskip 2in\hbox{\smallrm Paul Standard}
  297. \end{verse}\index{Zapf{,} Hermann}\index{Standard{,} Paul}
  298. \newpage %end page 1
  299. \mbox{   }
  300. \newpage %clear page 2
  301. \tableofcontents
  302.  
  303. \Makeodd
  304. E_O_F
  305. else
  306.   echo "will not over write ./doc/TYLMAN.00"
  307. fi
  308. chmod 644 ./doc/TYLMAN.00
  309. if [ `wc -c ./doc/TYLMAN.00 | awk '{printf $1}'` -ne 4174 ]
  310. then
  311. echo `wc -c ./doc/TYLMAN.00 | awk '{print "Got " $1 ", Expected " 4174}'`
  312. fi
  313. if `test ! -s ./doc/TYLMAN.01`
  314. then
  315. echo "writing ./doc/TYLMAN.01"
  316. cat > ./doc/TYLMAN.01 << 'E_O_F'
  317. \chapter*{ Introduction} 
  318. \label{introduction} 
  319. \TT\index{{\TT}} is a prototype post-processing system to be used in
  320. conjuction with {\TeX}\index{{\TeX}}\cite{knuth-tex82}, the typesetting program by Donald
  321. Knuth.  The purpose of \TT is to ``draw'' lines and curves in a
  322. device-independent manner. \TT is a post-processor that
  323. interprets certain commands in a {\DVI}\index{DVI} 
  324. ({\underline d}e{\underline v}ice-{\underline i}ndependent)
  325. file that is the
  326. output of {\TeX} and contains the actual typesetting commands.
  327. \TT will produce as its output another
  328. {\DVI} file that contains the commands to typeset the lines and
  329. curves on a printer or output device.\par
  330.  
  331. In the current version of \TT (version 1.2 of March 1987), the simple line drawing
  332. capabilities\index{capabilities} include several general types of straight lines, arcs, and
  333. spline curves. Advanced features of \TT are for {\it MusiCopy}\index{MusiCopy}, the
  334. music-typesetting\index{music} project  at the Ohio State
  335. University\cite{gourlay}, namely typesetting ties, slurs, and beams.\par
  336.  
  337. The name\index{{\TT}, name} for \TT comes from three ideas: (1) a proper computer graphics
  338. term for rendering images is called ``tiling,'' (2) the
  339. mis-pro\-noun\-ci\-ation of the name sounds like ``textile,'' which evokes an image
  340. of lines and bargello effects from weaving, and (3) this process of ``tyl''-ing\index{tyling} comes after {\TeX}.\par
  341.  
  342. The main design goals\index{design goals} of \TT were (1) the minimization of data required
  343. to typeset graphics on printers capable of setting only characters at
  344. arbitrary positions on a page,
  345. (2) the adherence to the  {\DVI} format of {\TeX} output for specifying the
  346. way to typeset a document in a device-independent manner,  (3)
  347.  a simple, portable interface that would not require a change to the
  348. functionality or design of {\TeX}, and (4) a user interface that is easy to
  349. use by people and programs alike.\par
  350.  
  351. \TT was not intended to mimic nor replace sexy programs like
  352. {\it Ideal\/}\index{Ideal}\cite{vanwyk}, which know about constraints 
  353. and alignment niceties.
  354. Rather, \TT is designed to
  355. take care of medium-level details for {\TeX} for use on printing devices not
  356. capable of directly accessing and 
  357. loading full bitmaps\index{bitmaps} produced by such systems as {\it
  358. PostScript\/}\index{PostScript}\cite{adobe}. It is clear that {\DVI}-format is a subset of {\it
  359. PostScript}, but a large community of users are not able to make use of such
  360. a super-set, and \TT is intended to provide line-drawing
  361. capabilities\index{capabilities} for them.\par
  362.  
  363. Probably the best way to read this manual\index{{\TT}, how to read manual}
  364.  is to read the first four (4) 
  365. chapters, and skip right to the chapter entitled {\it Future Extensions},
  366. for a good introduction to \TTN. The other chapters deal with details of 
  367. the innards of \TTN, and describe the design in successively finer
  368. detail.\par
  369.  
  370. I would like to thank John Gourlay, and Clayton Elwell for their support,
  371. comments, reminders, and good ideas during this three-year labor, and the 
  372. {\smallrm CGRG} for not hassling me about this.\par
  373.  
  374. \Makeodd
  375. E_O_F
  376. else
  377.   echo "will not over write ./doc/TYLMAN.01"
  378. fi
  379. chmod 644 ./doc/TYLMAN.01
  380. if [ `wc -c ./doc/TYLMAN.01 | awk '{printf $1}'` -ne 3110 ]
  381. then
  382. echo `wc -c ./doc/TYLMAN.01 | awk '{print "Got " $1 ", Expected " 3110}'`
  383. fi
  384. if `test ! -s ./doc/TYLMAN.02`
  385. then
  386. echo "writing ./doc/TYLMAN.02"
  387. cat > ./doc/TYLMAN.02 << 'E_O_F'
  388. \chapter{The Basics}
  389. \pagenumbering{arabic}
  390. \label{getting-started}So, let's draw.
  391. I will assume that the reader  has a reasonably good working knowledge of how to
  392. use {\TeX}\index{{\TeX}} and/or {\LaTeX}\index{{\LaTeX}}, and sort of understands
  393.  Knuth's\index{Knuth{,} Donald} concept of ``boxes,''\index{boxes} and their
  394. attributes of height, width, and current position\index{current position}. We need these concepts
  395. because our direct interface is with {\TeX}, in the form of a {\tt .tex}
  396. text-file\index{{\tt .tex} text file}. To typeset the line-drawings, we ask {\TeX} to place our drawing
  397. at the current position on the page. Throughout this manual, I will provide
  398. some examples of drawings to illustrate ideas. These figures are thumb-nail
  399. size, but should be sufficient to get the idea across without using up lots
  400. of space on a page.
  401.  Let's look at a simple example: After typing |\input{textyl}| \index{{\tt
  402. textyl.tex} file}\index{{\tt input}}
  403. near the
  404. beginning of your file, but after any required preamble\index{preamble}, we
  405. can obtain a trivial drawing like:
  406. \index{line example}\par
  407. \noindent\hskip 2in\begintyl{2truecm}[1in]
  408. \special{tyl line  4 20, 0; 80,30}
  409. \endtyl\par
  410. \noindent Simple, but we achieved this 
  411.  line by typing
  412. \begin{verbatim}
  413. ...a trivial drawing like:\par
  414. \noindent\hskip 2in\begintyl{2cm}[1in]
  415. \special{tyl line  4 20, 0; 80,30}
  416. \endtyl\par
  417. \end{verbatim}
  418.  
  419. The |\begintyl{2cm}[2in]| and |\endtyl| commands\index{macros}\index{space macros} were
  420. \index{{\tt begintyl}}\index{{\tt endtyl}}\index{macros, {\it see} {\tt begintyl}}to give us some
  421. space\index{space} to ``paste'' the picture in
  422. (about 2 centimeters of vertical space, 1 inch of horizontal space, 
  423. and offset from the left-most margin by 2 inches),\footnote{See also Appendix~\ref{secapp}} 
  424.  and the |\special...|\index{{\tt special}} is our way of asking for the above drawn line.
  425.  Here, we must use a ``|\special|'' to talk to {\TeX}
  426. at this level. Later, \TT will actually do the work involved in
  427. typesetting that line that {\TeX} recorded as being at this place on the
  428. page. The |\special|\index{specials} is a way to make a kind of note or memo that {\TeX}
  429. will write into the {\DVI} file for some other program like 
  430. \TT to work with, or choose to ignore, like most {\DVI}
  431. filters do. \par
  432.  
  433. Let's look at what |\special{tyl line 4 20, 0; 80,30}| is all about. First,
  434. |tyl| is a name-string\index{{\tt tyl} name-string} asserting that this command
  435.  should make sense to \TTN. 
  436. Next, |line| is the name of the graphic
  437. primitive\index{primitive}
  438.  to typeset: a
  439. line segment (we will get to the other primitives later). The rest of the ``special''
  440. notes that the thickness\index{line thickness} of the line is $4$, and to draw the line from a
  441. mark 20 printer's-points\index{printer's points, measurement} to the
  442.  right of the current position to a mark 80
  443. points over and 30 points higher from that current position. Mathematically,
  444. we are using a {\bf first-quadrant} cartesian
  445.  coordinate-space\index{cartesian-space}\index{coordinates}
  446.  whose origin\index{origin}\index{coordinates, origin} is at the
  447. current position\index{current position} on the page, and we are drawing a line from $(20,0)$ to 
  448. $(80,30)$ in integer units\index{measurement, units} of printer's-points in that space. It looks like this (magnified):\par
  449. \noindent\hskip 1in\begintyl{130 pt}
  450. \special{tyl beginfigure}
  451. \special{tyl line m 2 0,0 0,40}
  452. \special{tyl label m 1  0 43 "+Y"}
  453. \special{tyl line m 2 0 0 90 0}
  454. \special{tyl label m 1 93 0 "+X"}
  455. \special{tyl arc m 1 2 10 10}
  456. \special{tyl line m 8 20,0;80,30}
  457. \special{tyl line m 1 0 10, -2,10}
  458. \special{tyl line m 1 0 20, -2 20}
  459. \special{tyl line m 1 0 30 -2 30}
  460. \special{tyl line m 1 0 40 -2,38}
  461. \special{tyl line m 1 0 40 2 38}
  462.  
  463. \special{tyl line m 1 10 0 10 -2}
  464. \special{tyl line m 1 20 0 20 -2}
  465. \special{tyl line m 1 30 0 30 -2}
  466. \special{tyl line m 1 40 0 40 -2}
  467. \special{tyl line m 1 50 0 50 -2}
  468. \special{tyl line m 1 60 0 60 -2}
  469. \special{tyl line m 1 70 0 70 -2}
  470. \special{tyl line m 1 80 0 80 -2}
  471. \special{tyl line m 1 90 0 88 2}
  472. \special{tyl line m 1 90 0 88 -2}
  473. \special{tyl endfigure}
  474. \endtyl
  475. \par
  476. \vskip 10pt
  477. \noindent where we have emphasized the origin of the quadrant, and used
  478. tick-marks for every ten printer's-points. In reality, someone preparing a
  479. figure would sketch\index{figures, preparation}
  480. \index{preparing a figure} something out on grid paper, and then use those
  481. coordinates for use in the |\special|. If he were really in luck, he
  482. could use a graphic editor that would take care of such numeric details, and
  483. maybe even output the  |\special| strings for direct insertion into the
  484. {\tt .tex} file. Maybe. For now, we will have to stick to the grid-paper
  485. method. The only things that we have to remember are that the origin\index{grid-origin} of our
  486. quadrant is placed at the position\index{current position} on the page where we invoke the
  487. |\special| of {\TeX}, and that we may want to leave white space\index{space}\index{leaving white space} for our
  488. graphic to be drawn in. This last constraint is because {\TeX} does not
  489. really know about the size of our drawing, it thinks that the |\special| is
  490. a ``box''\index{boxes} with zero height and width placed at the current position on the
  491. page. It is up to us to decide how much {\it real\/} space to tell {\TeX} to
  492. leave for our drawing to be put into later by \TTN.\par
  493. In the example above,
  494. and the following examples, we will put our |\special| strings within an
  495. environment that makes it easy to specify where the origin of our quadrant
  496. should be placed. For example, |\begintyl{4cm}[1in]| \index{{\tt begintyl}}
  497.  tells {\TeX} to place
  498. our origin 4 centimeters down from where it was just sitting.
  499. A horizontal width is an optional second parameter to |\begintyl|,
  500. and is enclosed in square braces immediately following the vertical 
  501. displacement parameter (with no spaces in-between). So |\begintyl{5cm}|
  502. would place our origin 5 centimeters below the current position, with no
  503. relative horizontal width. Other spacing requirements have to be done by
  504. hand (e.g., like typing |\hskip 1in| before the |\begintyl|), or by putting the whole
  505. |\begintyl| \ldots |\endtyl| group within a containing environment (e.g.,
  506. \LaTeX's |figure| environment).
  507.  We could, if
  508. we wanted,
  509. leave no extra white-space\index{leaving no space} and have the drawing extend  into
  510.  and over any text that {\TeX} may typeset
  511. before {\it or\/} after we invoke a |\special{tyl ...}| command. We would,
  512. of course, start that  tyling-environment with a 
  513.  |\begintyl{0pt}| command, and finish with the |\endtyl| command, and it
  514. might do something
  515.  like \begintyl{0pt}\special{tyl arc m 3 5 @4 0;5 5}\endtyl this.
  516. \par
  517.  
  518. \goodbreak Once we are satisfied with our {\tt .tex}\index{{\tt .tex} text file}
  519.  file containing |\special| strings
  520. requesting line-drawings, we run the {\tt .tex} file through
  521.  {\TeX}\index{{\TeX}} or {\LaTeX}\index{{\LaTeX}}, and
  522. (barring any fatal errors) end up with a {\tt .dvi} file\index{{\tt .dvi} file}. 
  523. We now run\index{running {\TT}}
  524.  this {\tt .dvi} file through \TT which goes through the file and converts our
  525. |\special| strings left-over from {\TeX} into commands to actually typeset
  526. the line-drawing. The whole process might look something like this:\par
  527.  
  528. \bgroup\small
  529. {\it prompt:}\underbar{\tt tex}\par
  530. {\tt This is TeX, Version mumble...}\par
  531. {\tt **}\underbar{\tt myfile.tex}\par
  532. \hspace*{6em}$\ldots$ {\it output from \TeX}\par
  533. {\tt Output written on myfile.dvi ( n pages , m bytes).}\par
  534. {\it prompt:}\underbar{\tt textyl}\par
  535. {\tt This is TeXtyl, Version blah...}\par
  536. {\tt DVI-input File Name:}\underbar{\tt myfile.dvi}\par
  537. {\tt DVI-output File Name}\par
  538. {\tt (different than input name)[default of myfile.tyl]:}
  539. \underbar{\tt myfile2.dvi}\par
  540. \hspace*{6em}$\ldots$ {\it output  from \TT}\par
  541. {\tt Output written on myfile2.dvi}\par
  542. {\tt Log written on myfile2.tlog}\par
  543.  
  544. \egroup
  545. \noindent So there you have it. All we have to do is give this 
  546. new {\tt .dvi} (or {\tt .tyl}) file to
  547. a favorite {\DVI} filter\index{DVI-filters}, and look at the document with the
  548. line-drawing results on that particular filter's output device\index{output
  549. device}
  550. (usually paper or a bitmapped screen). You should
  551. contact your local maintainer\index{local maintainer} if \TT or the filter
  552.  cannot find the right fonts, and try again.\par
  553. By the way, the {\tt .tlog} file is useful for finding out about the
  554. ``tyling'' of the {\tt .dvi} file. Besides noting any errors, the log file
  555. contains the approximate height and depth of each non-trivial figure. A
  556. portion of the {\tt .tlog}\index{{\tt .tlog} file} file for this document 
  557. might look like:
  558. \vspace*{-20pt}
  559.  
  560. {\footnotesize\begin{verbatim}
  561. 17] [
  562. Figure #1 on page 18 is approx. 33 pts high and 47 pts wide
  563.  
  564. Figure #2 on page 18 is approx. 32 pts high and 51 pts wide
  565.  
  566. Figure #3 on page 18 is approx. 27 pts high and 45 pts wide
  567.  
  568. Figure #4 on page 18 is approx. 31 pts high and 82 pts wide
  569. 18] [19] [20] [
  570. \end{verbatim}
  571.  
  572. }
  573. This information allows you to re-edit the parameters to |\begintyl| so that
  574. \index{{\tt begintyl}} they can better approximate the actual sizes of the figures.\par
  575. \medskip\filbreak
  576. Let's try a slightly more complicated example: drawing a spline.\index{spline, example} 
  577. \TT understands drawing smooth spline curves\index{spline curves}\index{curves} through 
  578. in\-teger co\-ordinate points (both positive and negative)\index{spline, coordinates}
  579.  on our grid. For example:
  580. \vspace*{-10pt}
  581. \begin{verbatim}
  582. \begintyl{3cm}[1in]
  583. \special{tyl spline m 4 K 7 5,10; 9,14; 15,7;22,13;
  584.                                17,14;12,5;7,0;}
  585. \endtyl\par
  586. \end{verbatim}
  587. yields\par
  588. \noindent\hskip 1in\begintyl{2cm}[1in]
  589. \special{tyl spline m 4 K 7 5,10; 9,14; 15,7; 22,13;17,14;12,5; 7,0; }
  590. \endtyl
  591. \par\filbreak
  592. \noindent Here, we are using units of millimeters for measurement (denoted
  593. by an |m| or |M|,\index{{\tt M}-marker}\index{millimeters, measurement} a line thickness of $4$, and we
  594.  want to use a Catmull-Rom type spline\index{spline,
  595. Catmull-Rom}\index{Catmull-Rom splines}
  596. (denoted by |k| or |K|\index{{\tt K}-marker}---also the default type\index{spline, 
  597. default}
  598.  if none is specified). We 
  599.  specify that there are $7$ control points\index{spline, control-points} 
  600. to interpolate through, and then
  601. list those $x, y$ pairs.  Some things are optional
  602. \index{defaulting values}\index{optional values}
  603.  for you (like the spline type, or the units of measure), but
  604. some are {\it not\/} (notably the line-thickness and the number of control points).
  605. As we go through these examples, I will point out the minimum that we
  606. need to specify a graphic primitive, and note other options or features that
  607. we might want to use. For a detailed look at the specifications of the
  608. primitives, please refer to the \underbar{\it User-Level
  609. Details} in chapter~\ref{user-level}.\par\filbreak
  610.  
  611. Let's try one more type of spline-primitive: the thick-n-thin
  612. spline\index{ttspline}\index{Thick-n-thin spline}\index{spline, ttspline}. This
  613. is a primitive that lets us specify a spline of varying line thickness along
  614. the spline. An example\index{ttspline, example} invocation might be:
  615. \begin{verbatim}
  616. \special{TYL ttspline m 5 4,6; 14,25; 18,19; 21,15; 24,8;
  617.                            10;    2;    6;     3;     8}
  618. \end{verbatim}\par
  619. \noindent\hskip 1in
  620. \begintyl{4cm}[2in]
  621. \special{tyl ttspline m 5 4,6; 14,25; 18,19; 21,15; 24,8;
  622.               10;    2;    6;    3;    8}
  623. \endtyl\par
  624. \noindent It looks similar to the |spline| primitive, but here we did not
  625. specify a single line thickness right after the |m|\index{{\tt M}-marker}
  626.  measure-marker. The |5|
  627. refers to the number of control-points as before, then is followed by the
  628. $(x,y)$ coordinate pairs, and then  the line-thicknesses\index{ttspline, thicknesses}. The first
  629. number (here, |10|) refers to the line thickness at the first control-point
  630. (here, $(4,6)$ ); the next for the second control-point, etc. We did not
  631. need to align the thicknesses under the control-points, but  it
  632. makes the correspondence more apparent.  We did not
  633. specify the type of spline to use, so the Catmull-Rom interpolating spline
  634. was used by default\index{ttspline, defaults}. We could have inserted a
  635.  |b| marker\index{{\tt B}-marker}
  636.  directly before the number of control-points,\label{thebases}
  637. and gotten a spline using the B-spline basis\index{B-spline
  638. basis}.\index{spline, B-spline}
  639.  Using 
  640. a |d| marker\index{{\tt D}-marker} yields a spline with the Cardinal
  641. basis\index{Cardinal basis},\index{spline, Cardinal} and
  642. an |i|\index{{\tt I}-marker} would indicate an
  643. Interpolating B-spline\index{B-splines, interpolating-type}\index{spline,
  644. Interpolating B-spline}
  645.  (which is a little different)\index{interpolating B-spline}. We will
  646. look closer at these spline-types on page~\pageref{diffsplines}.
  647. \par\filbreak
  648.  
  649. If you've been very observant, you may have noticed that the way we type in
  650. the |\special| strings\index{typing in special
  651. strings}\index{specials, typing in}
  652.  (the letters and numbers within the |{| -- |}| pair)
  653. has been rather indiscriminant about upper vs. lower-case\index{specials, case insensitivity}.
  654.  That's okay. \TT
  655.  has only a few things to worry about, and so it will try to
  656. figure things out for you. It is pretty lenient about how you
  657. punctuate\index{specials, punctuation}
  658.  and
  659. separate (``delimit'')\index{delimiters} keywords\index{keywords}
  660.  and markers\index{markers}.\goodbreak\filbreak  We only have to remember 
  661. \begin{enumerate}
  662. \item the relative ordering of the keywords and integers,
  663. \item being careful to avoid
  664. mis-using the word markers\footnote{See the index for a list of markers} in
  665. the wrong places, and
  666. \item supplying enough parameters that are expected.
  667. \end{enumerate}
  668. Other than its own macro-expansions, {\TeX} really
  669.  doesn't care about the ``meaning'' of the final strings that
  670.  goes inside the curly braces of the 
  671. |\special{...}| command-strings, only \TT does.\par
  672.  
  673. We'll briefly look at an example of one more graphic primitive, and then get
  674. on to more advanced topics. \TT has the ability to draw arcs and
  675. circles like\index{arcs}\index{circles}:\par
  676. \noindent\hskip 2in\begintyl{7truecm}[2in]
  677. % 15-Mar-87 15:51:23
  678. % TeXtyl figure written with width= 198 mm and height= 206 mm
  679. %   you may have to scale it with Transform or Fit operators in beginfigure
  680. \special{tyl beginfigure m W 198 206 F 50 50}
  681. \special{tyl arc m 3 c 64 @(134 114) 357 54}
  682. \special{tyl arc m (T 120 80 0 0 0) 3 c 31 @(36 31) 10 10}
  683. \special{tyl arc m 3 c 53 @(129 77) 94 58}
  684. \special{tyl arc m 3 c 66 @(85 140) 27 323}
  685. \special{tyl arc m 1 c 57 @(57 100) 10 10}
  686. \special{tyl endfigure}
  687. \endtyl\par\filbreak
  688. \noindent Arcs are drawn from an initial angle (measured
  689. from the horizontal (positive x-axis) in integer degrees) counter-clockwise 
  690. to a final angle with 
  691. the arc centered about the origin.\index{arcs, angles}\index{arcs, center}
  692.  If the
  693. initial angle is the same as the final angle, we get a full circle\index{circles}\index{arcs, circles}.
  694. A simple arc invocation might look like\index{arcs, example}:\par
  695. |\special{tyl arc m 2 3, 48, 280}|\par
  696. \noindent which would draw an arc of line thickness $2$, a radius\index{arcs, radius} of $3$
  697. millimeters, from an initial angle of 48 degrees until the final angle of 280
  698. degrees centered about the origin. We could specify that the arc is to be
  699. centered\index{arcs, centering}
  700. elsewhere by using a special |@|\index{{\tt @}-marker} marker. So,\par
  701. |\special{tyl arc m 2 3, @ 7,7; 10 10  }|\par
  702. \noindent would draw an arc of line-thickness $2$, radius of $3$ mm as before,
  703. but centered at $(7,\, 7)$ from the origin. Also, since the initial and final
  704. angles are the same in this example (|10|), we would get a full circle.
  705. \par\vfill\pagebreak[4]
  706. %\Makeodd
  707. E_O_F
  708. else
  709.   echo "will not over write ./doc/TYLMAN.02"
  710. fi
  711. chmod 644 ./doc/TYLMAN.02
  712. if [ `wc -c ./doc/TYLMAN.02 | awk '{printf $1}'` -ne 15730 ]
  713. then
  714. echo `wc -c ./doc/TYLMAN.02 | awk '{print "Got " $1 ", Expected " 15730}'`
  715. fi
  716. if `test ! -s ./doc/TYLMAN.03`
  717. then
  718. echo "writing ./doc/TYLMAN.03"
  719. cat > ./doc/TYLMAN.03 << 'E_O_F'
  720. \chapter{Advanced Features}
  721. \label{advanced-features}In the previous chapter, we saw basic examples of most of the graphic
  722. primitives available in \TTN, how to invoke them\index{primitives, invoking}, and some of
  723. the parameters\index{primitives, parameters} to the primitives. We also saw examples of how we interface
  724. with {\TeX} using the |\special| command strings, and how the origin of our
  725. drawing quadrant is placed at the reference point  of the ``box'' containing
  726. the |\special| (usually the lower-left corner of the box created with the
  727. |\begintyl| and |\endtyl| macros.\index{macros}\index{boxes}
  728.  (see the {\TeX book}\cite{knuth-tex82}\index{\TeX book} for a better explaination of
  729. ``specials''). The rest of this chapter will look more at
  730. the parameters available for the primitives, and how we can
  731. combine\index{primitives, combining}\index{combining primitives}
  732. primitives and manipulate them.\par
  733.  
  734. \section{Transforms}
  735. \label{transforms}\index{transforms}
  736. The most interesting additional parameter for the primitives is a transform
  737. operation. It allows us to modify an already-exisiting definition of a
  738. primitive without our having to totally re-edit the |\special|
  739. string, nor having
  740. to explicitly re-compute the  coordinates of the line/spline points.
  741. Thus we can take a simple definition similar as before, like:\par
  742. |\special{tyl line m 4 0,8; 39,44}|\par
  743. \noindent and change its size, or rotate it, or translate (shift)
  744. its position\index{scaling}\index{rotation}%
  745. \index{translating}\index{primitives, scaling; rot\-ating; trans\-lating}
  746. without completely changing the actual text of the
  747.  specification of the control points (this is really useful
  748. when dealing with splines having many control points).
  749. \index{transforms, scaling}\index{transforms, rotating}
  750. \index{transforms, translation}
  751. \filbreak
  752.  Let's look at an
  753. example, and then go into more detail about the transform. For example, to
  754. rotate the above definition about its center by 60 degrees
  755. counter-clockwise, all we have to specify is
  756. |\special{tyl line m T (100, 100, 0, 0, 60) 4 0,8; 39, 44}|
  757.  which yields\index{transforms, example}\par
  758. \noindent\hskip 1in\begintyl{1in}[2in]
  759. % 15-Mar-87 15:47:50
  760. % TeXtyl figure written with width= 196 mm and height= 71 mm
  761. %   you may have to scale it with Transform or Fit operators in beginfigure
  762. \special{tyl beginfigure m W 196 71 F 51 51}
  763. \special{tyl line m 4 c 170 0 154 71}
  764. \special{tyl line m 4 c 54 61 0 11}
  765. \special{tyl line m 1 c 109 28 114 37}
  766. \special{tyl line m 1 c 107 45 114 37}
  767. \special{tyl line m 1 c 110 34 87 34}
  768. \special{tyl line m 1 c 111 37 89 37}
  769. \special{tyl line m 1 c 110 39 87 39}
  770. \special{tyl endfigure}
  771. \endtyl\par
  772. \noindent as expected. We use the |T|\index{{\tt T}-marker} marker to note the need for a
  773. transformation, and follow it by five numbers\index{transforms, parameters}.
  774.  The first two are for
  775. scaling, the next two for translation, and the last (here, |60|) is for our
  776. rotation.  In general, the 
  777. format for specifying some transformation on the currently-specified points
  778. is:\par
  779. \qquad{\btt T}\ \Prm{Sx}\Coma\Prm{Sy}\Coma\Prm{Tx}\Coma\Prm{Ty}\Coma\Prm{Rot}\Coma\par
  780. \noindent where \Prm{Tx} and \Prm{Ty} are translations of the object in
  781.  the $X$ or $Y$ direction, respectively, by some signed distance according to the 
  782. current units of \Prm{measure} (|m|\index{{\tt M}-marker} still means millimeters in the above example).
  783.  \Prm{Rot} is a signed integer angle (in degrees) \index{rotation} 
  784. by which\index{rotation, using degrees measurement}
  785. to rotate the primitive counter-clockwise about its center.
  786.   \Prm{Sx} and \Prm{Sy} are\index{transforms, parameters}
  787. integer scale parameters representing the real values of the 
  788. transform multiplied by 100. For example, if you wanted to scale the drawing
  789. in the $X$ direction (relative to the drawing's center)
  790.  by an additional 50\% (i.e., scale by 1.5),
  791. \Prm{Sx} would be 150. Negative values are usuable, too, so
  792. mirroring\index{transforms, mirroring} about the $Y$ axis is achievable by
  793. scaling in the negative $X$ direction, like $\Prm{Sx} = -100$.
  794. To obtain any transform, {\it all\/} the transform parameters must be
  795. specified. A no-op transform\index{transforms, no-op} would look kind of like
  796. {\tt T~(100,~100,~\kern-1pt0,~\kern-1pt0,~\kern-1pt0)} in the middle of 
  797. the |\special|. \par 
  798.  
  799. \section{Figures}
  800. \label{figures}
  801. The last major \TT concept is the idea of combining 
  802. several primitives\index{primitives, combining} into what we call a
  803. ``figure.''\index{figures}\index{combining primitives}
  804. This figure can be manipulated either as a single entity  or in parts
  805. by
  806. using the \Prm{transform} operations\index{figures, transforms} described 
  807. in the previous section. 
  808. These optional figure-level transformations
  809. will transform all the figure's primitives (which may have local
  810. transformations of their own). The result is a nested symbol definition
  811. \index{nested symbols}\index{figures, nested symbols}
  812. that has concatenatable transformations\index{transforms, concatenation}. 
  813. This is useful for defining some
  814.  symbol, created from various primitives, and dealing with it 
  815. as a unit. For example,  a basic logotype can be defined, and then moved
  816. about, scaled, or rotated as desired {\it without\/} having to change the
  817. original definition of the logotype or its parts from scratch. 
  818. These  commands are:\par
  819. \medskip
  820. {\btt\char'134 special\char'173 tyl beginfigure}
  821. {\leavevmode \hbox{$\>\lbrack\langle${\it transform\/}$\rangle\,
  822. \rbrack\,$}}{\btt\char'175}\par
  823. \noindent which opens a level of definition\index{{\bf beginfigure}}\index{figures, defining},
  824. and\par
  825. \medskip
  826. {\btt\char'134 special\char'173 tyl endfigure}{\btt\char'175}\par
  827. \noindent which closes that level of definition\index{{\bf endfigure}}.
  828.  Any calls to a
  829. |\special{tyl ...| primitive within a |beginfigure| -- |endfigure| pair
  830. become part of that figure's definition\index{figures, sub-figures}. 
  831. Note the definition of |beginfigure| allows the ability to apply a
  832. transformation at the outer level. A simple example might be:\index{figures,
  833. examples}\vspace*{-10pt}
  834. \begin{verbatim}
  835. \begintyl{2in}
  836. \special{tyl beginfigure}
  837.     \special{tyl line m 2 5,10; 15,15 }
  838.     \special{tyl line m 4 10,20; 16,1 }
  839.     \special{tyl line m 8 15,10; 25,10 }
  840. \special{tyl endfigure}
  841. \endtyl
  842. \end{verbatim}
  843. giving a figure of three lines:\par
  844. \noindent\hskip 2in\begintyl{1truein}[2in]
  845. \special{tyl beginfigure "oflines"}
  846. \special{tyl line m 2 5,10; 15,15 }
  847. \special{tyl line m 4 10,20; 16,1 }
  848. \special{tyl line m 8 15,10; 25,10 }
  849. \special{tyl endfigure "oflines" }
  850. \endtyl\par
  851. \noindent We can also define sub-figures\index{sub-figures} within figures
  852. and apply\label{sub-figures}
  853. transformations\index{transforms, sub-figures} to those, too. The idea looks like:\par
  854. |\begintyl{down-distance}[optional-width]|\par
  855. |\special{tyl beginfigure}|\par
  856. \qquad    $\ldots$\par
  857. \qquad|\special{tyl beginfigure}|  {\it \% Some sub-figure }\par
  858. \qquad    $\ldots$\hbox{\hskip 2in}   {\it \% of other primitives}\par
  859. \qquad|\special{tyl endfigure}|\par
  860. \qquad   $\ldots$\par
  861. |\special{tyl endfigure}|\par
  862. |\endtyl|\par
  863. \noindent Where ``$\ldots$'' means possible other invocations of
  864. primitives with |\special{tyl...}| strings.  We are
  865. able to use spacing and tabbing to nicely indent our |\special| strings,
  866. since {\TeX} considers all that white space to be non-existent within the 
  867. |\begintyl| -- |\endtyl| environment.\index{{\tt begintyl}}\index{{\tt
  868. endtyl}}
  869. \par\filbreak
  870.  
  871. We'll look at a basic figure\index{figures, example}, and apply some
  872. transforms to parts of it. 
  873.  For the basic figure, we have:\par
  874. \noindent\hskip 2in\begintyl{1in}[2in]
  875. \special{tyl beginfigure "TeXtyl-logo-1"}
  876.      \special{tyl beginfigure "tex-logo"}
  877.     \special{tyl line m 3 2,13; 10,13}
  878.     \special{tyl line m 3 6,13; 6,6}
  879.  
  880.     \special{tyl line m 3 8,11;8,4}
  881.     \special{tyl line m 3 8,11;12,11}
  882.     \special{tyl line m 3 8,8; 11,8}
  883.     \special{tyl line m 3 8,4;12,4}
  884.  
  885.     \special{tyl line m 3 13,13;18,6}
  886.     \special{tyl line m 3 13,6;18,13}
  887.     \special{tyl endfigure}
  888.     \special{tyl beginfigure  "tyl-logo"}
  889.     \special{tyl line m 3 20,10;24,10}
  890.     \special{tyl line m 3 22,12;22,6}
  891.  
  892.     \special{tyl line m 3 25,10;27,6}
  893.     \special{tyl line m 3 29,10;26,2}
  894.  
  895.     \special{tyl line m 3 31,13;31,6}
  896.     \special{tyl endfigure}
  897. \special{tyl endfigure}\endtyl\par\filbreak
  898. \noindent Now let's scale a sub-figure by using a |T|\index{{\tt T}-marker}
  899.  transform at the 
  900. |beginfigure| level; i.e., something like 
  901. \verb+\special{tyl beginfigure T 60 60 0 0 0}+ :\par
  902. \noindent\hskip 2in\begintyl{ 1in}[2in]
  903. \special{tyl beginfigure "TeXtyl-logo-2"}
  904.      \special{tyl beginfigure "tex-logo"}
  905.     \special{tyl line m 3 2,13; 10,13}
  906.     \special{tyl line m 3 6,13; 6,6}
  907.  
  908.     \special{tyl line m 3 8,11;8,4}
  909.     \special{tyl line m 3 8,11;12,11}
  910.     \special{tyl line m 3 8,8; 11,8}
  911.     \special{tyl line m 3 8,4;12,4}
  912.  
  913.     \special{tyl line m 3 13,13;18,6}
  914.     \special{tyl line m 3 13,6;18,13}
  915.     \special{tyl endfigure}
  916.     \special{tyl beginfigure T 60 60 0 0 0  "tyl-logo"}
  917.     \special{tyl line m 3 20,10;24,10}
  918.     \special{tyl line m 3 22,12;22,6}
  919.  
  920.     \special{tyl line m 3 25,10;27,6}
  921.     \special{tyl line m 3 29,10;26,2}
  922.  
  923.     \special{tyl line m 3 31,13;31,6}
  924.     \special{tyl endfigure}
  925. \special{tyl endfigure}\endtyl\par\filbreak
  926. \noindent We can rotate, and then also translate that same
  927. sub-figure and achieve the next two examples. First, a rotation about 
  928. the sub-figure's center:\par
  929. \noindent\hskip 2in\begintyl{ 1in}[2in]
  930. \special{tyl beginfigure "TeXtyl-logo-3"}
  931.      \special{tyl beginfigure "tex-logo"}
  932.     \special{tyl line m 3 2,13; 10,13}
  933.     \special{tyl line m 3 6,13; 6,6}
  934.  
  935.     \special{tyl line m 3 8,11;8,4}
  936.     \special{tyl line m 3 8,11;12,11}
  937.     \special{tyl line m 3 8,8; 11,8}
  938.     \special{tyl line m 3 8,4;12,4}
  939.  
  940.     \special{tyl line m 3 13,13;18,6}
  941.     \special{tyl line m 3 13,6;18,13}
  942.     \special{tyl endfigure}
  943.     \special{tyl beginfigure T 60 60 0 0 -35 "tyl-logo"}
  944.     \special{tyl line m 3 20,10;24,10}
  945.     \special{tyl line m 3 22,12;22,6}
  946.  
  947.     \special{tyl line m 3 25,10;27,6}
  948.     \special{tyl line m 3 29,10;26,2}
  949.  
  950.     \special{tyl line m 3 31,13;31,6}
  951.     \special{tyl endfigure}
  952. \special{tyl endfigure}\endtyl\par\filbreak
  953. \noindent and now also translated {\it after\/} the rotation:\par
  954. \noindent\hskip 2in\begintyl{1in}[2in]
  955. \special{tyl beginfigure "TeXtyl-logo-4"}
  956.      \special{tyl beginfigure "tex-logo"}
  957.     \special{tyl line m 3 2,13; 10,13}
  958.     \special{tyl line m 3 6,13; 6,6}
  959.  
  960.     \special{tyl line m 3 8,11;8,4}
  961.     \special{tyl line m 3 8,11;12,11}
  962.     \special{tyl line m 3 8,8; 11,8}
  963.     \special{tyl line m 3 8,4;12,4}
  964.  
  965.     \special{tyl line m 3 13,13;18,6}
  966.     \special{tyl line m 3 13,6;18,13}
  967.     \special{tyl endfigure}
  968.     \special{tyl beginfigure T 60 60 -8 -8 -35  "tyl-logo"}
  969.     \special{tyl line m 3 20,10;24,10}
  970.     \special{tyl line m 3 22,12;22,6}
  971.  
  972.     \special{tyl line m 3 25,10;27,6}
  973.     \special{tyl line m 3 29,10;26,2}
  974.  
  975.     \special{tyl line m 3 31,13;31,6}
  976.     \special{tyl endfigure}
  977. \special{tyl endfigure}\endtyl\par\filbreak
  978. \noindent Finally, we can take the whole figure, and perform a scale and a
  979. then a rotation on it (we evaluate scaling first, then rotations and finally
  980. translations):\par
  981. \noindent\hskip 2in\begintyl{3cm}[2in]
  982. \special{tyl beginfigure T 80 80 0 0 60  "TeXtyl-logo-5"}
  983.      \special{tyl beginfigure "tex-logo"}
  984.     \special{tyl line m 3 2,13; 10,13}
  985.     \special{tyl line m 3 6,13; 6,6}
  986.  
  987.     \special{tyl line m 3 8,11;8,4}
  988.     \special{tyl line m 3 8,11;12,11}
  989.     \special{tyl line m 3 8,8; 11,8}
  990.     \special{tyl line m 3 8,4;12,4}
  991.  
  992.     \special{tyl line m 3 13,13;18,6}
  993.     \special{tyl line m 3 13,6;18,13}
  994.     \special{tyl endfigure}
  995.     \special{tyl beginfigure  "tyl-logo"}
  996.     \special{tyl line m 3 20,10;24,10}
  997.     \special{tyl line m 3 22,12;22,6}
  998.  
  999.     \special{tyl line m 3 25,10;27,6}
  1000.     \special{tyl line m 3 29,10;26,2}
  1001.  
  1002.     \special{tyl line m 3 31,13;31,6}
  1003.     \special{tyl endfigure}
  1004. \special{tyl endfigure}\endtyl
  1005. \par\filbreak
  1006.  
  1007. \section{Others}
  1008. We'll finish off this section with a couple more primitives: a simple spline
  1009. example, and the primitives for a music-typesetting project underway at Ohio
  1010. State University\cite{gourlay}\index{OSU}. The first example is not really that different from our
  1011. first spline example, except that in this case, we have a ``closed'' 
  1012. spline:\index{splines, closed}\index{closed splines} one whose
  1013.  first control-point will coincide with its last control-point.
  1014. We can type something that looks like:
  1015. \begin{verbatim}
  1016. \special{tyl spline m 3 b O 8 (10,9) (4,16) (8,23)
  1017.         (11,21) (13,17) (20,16) (22,13) (19,8)}
  1018. \end{verbatim}\par
  1019. \noindent  The |O| (letter ``Oh'')\index{{\tt O}-marker}
  1020.   marker denotes a closed spline\index{closed splines}. The default
  1021. option is an ``open'' spline\index{open spline}\index{splines, open},
  1022.  and can be marked with a |U|\index{{\tt U}-marker} instead of the
  1023. |O| if you wish to be explicit. 
  1024. The difference is in the way that \TT
  1025. manipulates the control points when doing the interpolation.
  1026.  In this example, we used a B-spline, as marked with a
  1027. |b|\index{{\tt B}-marker}, and  we listed {\it only\/} the unique 
  1028. coordinates to get this nice bean-shape:\par
  1029. \noindent\begintyl{3cm}[2in]
  1030. \special{tyl spline m 3 b O 8 10,9;4,16;8,23;11,21;13,17;20,16;22,13;19,8}
  1031. \endtyl\par
  1032.  
  1033. \label{diffsplines}\TT provides three types of spline interpolation which I alluded to on
  1034. page~\pageref{thebases}.  The Catmull-Rom basis is probably the most
  1035. intuitively useful spline for users. It produces a smooth curve that goes
  1036. \index{splines, Catmull-Rom, example}
  1037. through the control points (which we can mark with dots):\par
  1038. \noindent\hskip 1in\begintyl{1in}[1in]
  1039. \special{tyl spline m 2 K X 8 7 5,10; 9,14; 15,7; 22,13;17,14;12,5; 7,0;}
  1040. \endtyl\par
  1041. The Cardinal basis\index{splines, Cardinal, example} is of the same family
  1042. as the Catmull-Rom. It, too, interpolates through the control points, and is
  1043. included for convenience and as an alternative to the Catmull-Rom. For
  1044. example:\par
  1045. \noindent\hskip 1in\begintyl{1in}[1in]
  1046. \special{tyl spline m 2 D X 8 7 5,10; 9,14; 15,7; 22,13;17,14;12,5; 7,0;}
  1047. \endtyl\par
  1048. The B-spline\index{splines, B-spline, example} is a little different in that
  1049. the curve {\it approximates\/} the control points. Using the same control points as
  1050. the above example, but using the B-spline basis, we see:\par
  1051. \noindent\hskip 1in\begintyl{1in}[1in]
  1052. \special{tyl spline m 3 B X 8 7 5,10; 9,14; 15,7; 22,13;17,14;12,5; 7,0;}
  1053. \endtyl\par
  1054. For the most part, you will probably want to draw curves through the control
  1055. points that you specify, and so the Catmull-Rom basis is the 
  1056. convenient default. The B-spline type is provided for completeness for users
  1057. who might have data using that basis.\par
  1058.  
  1059.  There {\it are\/} times when the Catmull-Rom or Cardinal bases give flakey
  1060. curves and the B-spline basis is not appropriate either. \TT provides a
  1061. fourth type of spline for these situations: an interpolating B-spline
  1062. curve.\index{splines, Interpolating B-spline, example} It has the advantages
  1063. of Catmull-Rom's interpolation, and the special flexibilities of the
  1064. B-spline, but is computationally more expensive. See \cite{wu-abel} or \cite{barsky} for a
  1065. complete explanation. Here is an example using the same control points as
  1066. the above examples, but using the interpolating B-spline:\par
  1067. \noindent\hskip 1in\begintyl{1in}[1in]
  1068. \special{tyl spline m 3 I X 8 7 5,10; 9,14; 15,7; 22,13;17,14;12,5; 7,0;}
  1069. \endtyl\par
  1070.  
  1071. For the {\it MusiCopy\/}\index{MusiCopy} project, we have the ability to draw ties and slurs
  1072. \index{ties}\index{slurs}---the long arcs connecting groups of notes. For the most part, I assume
  1073. that there is a program that is going to take care of the details of knowing where these
  1074. graphic elements are to be placed, and will produce the correct |\special|
  1075. string for inclusion in the {\tt .tex} file, but I will give an example for
  1076. completeness.\filbreak This graceful arc is produced by specifying a minimum and
  1077. \index{ties, {\it see also} slurs}\index{slurs, {\it see also} ties}
  1078. \index{ties, example} maximum thickness, and the five control points for the shape.\par
  1079. \noindent\begintyl{4truecm}[2in]
  1080. \special{tyl tieslur m 2 8 5 5,10; 7,13;15,16;24,17; 28,15 }
  1081. \endtyl\par\filbreak
  1082.  
  1083. \noindent The call looked like\index{tieslur, example}:\par 
  1084. |\special{tyl tieslur m 2 8 5 (5,10)(7,13);[15,16];(24,17); 28,15 }| \par 
  1085. \noindent where |2| and |8| are the min and\index{tieslur, thicknesses}
  1086. max thicknesses at the endpoints and the middle, respectively. The following
  1087. |5| is for the number of control points, and the five pairs of integers
  1088. following that are the coordinates of the points. We use a special way of
  1089. producing a smooth and gradual thin to thick to thin line-thickness, 
  1090. but  will discuss it in a later chapter.\index{ties, and ttsplines}\par\filbreak
  1091.  
  1092. The last example is the most specialized for the music project: beams\index{beams}. We'll
  1093. just look at an example of how they are called and appear, and leave the
  1094. details for the next chapter.\par
  1095. \noindent\begintyl{3truecm}[2in]
  1096. \special{tyl beginfigure "beams" }
  1097.     \special{tyl beam m 0 3,20; 15,23 }
  1098.     \special{tyl beam m 0 g 3,10;11,7 }
  1099. \special{tyl endfigure }\endtyl\par
  1100. \noindent The basic order of the parameters looks something like:\par
  1101. |\special{tyl beam m 0 g 3,10;11,7 }|\par
  1102. \noindent where |0| (zero) is the ``staff-size,''\index{staff-size}
  1103.  |g|\index{{\tt G}-marker} indicates a beam size for
  1104. ``grace'' notes\index{grace-notes} (|r|\index{{\tt R}-marker} 
  1105. is the default for ``regular'' sized notes), and the
  1106. last two pairs are the coordinates of the line-segment that the beam is to be
  1107. centered over.\par
  1108.  
  1109. \Makeodd
  1110. E_O_F
  1111. else
  1112.   echo "will not over write ./doc/TYLMAN.03"
  1113. fi
  1114. chmod 644 ./doc/TYLMAN.03
  1115. if [ `wc -c ./doc/TYLMAN.03 | awk '{printf $1}'` -ne 17492 ]
  1116. then
  1117. echo `wc -c ./doc/TYLMAN.03 | awk '{print "Got " $1 ", Expected " 17492}'`
  1118. fi
  1119. if `test ! -s ./doc/TYLMAN.04`
  1120. then
  1121. echo "writing ./doc/TYLMAN.04"
  1122. cat > ./doc/TYLMAN.04 << 'E_O_F'
  1123. \chapter{User-Level Details}
  1124. \label{user-level}
  1125. From the user's point of view\index{user's view} using {\TeX}\index{{\TeX}},
  1126.  commands\index{{\TeX} commands}\index{specials} that \TT 
  1127. interprets will look like the word ``|tyl|'', followed by
  1128.  the name of the graphic to typeset, then a
  1129. list of parameters\index{parameters to {\TT}}\index{{\TT}, parameters} 
  1130. all enclosed within the curly 
  1131. braces of a \hbox{|\special{...}|} command.
  1132. This use of a |\special| could be produced
  1133. by some other program (a graphic editor, for example),
  1134. \index{graphic editors} and the text strings merely
  1135. inserted into the {\tt .tex} text-file. \par
  1136.  
  1137. As far as the user is concerned, he is pasting in a picture at the current
  1138. position\index{current position} on the page where he invokes the |\special|. The user should
  1139. think of this picture as being a box just big enough to contain all the
  1140. lines of his graphic image, and whose first-quadrant cartesian
  1141.  origin is the reference\index{origin of quadrant}\index{reference point}
  1142. point that will be placed at the current position on the page. Thus, he
  1143. might want to  make sure that there is enough blank space \index{blank space}around the current
  1144. position on the page to contain the
  1145. image before he tries to ``paste it in.'' Space can be created by using
  1146. \TeX's |\hskip| or |\vskip|, or \LaTeX's |\hspace| and |\vspace| commands,
  1147. \index{{\TeX}}\index{{\LaTeX}} or hoping for the best with \LaTeX's
  1148. |figure| environment \index{{\LaTeX}, {\tt figure } environment} surrounding
  1149. the box created by |\begintyl| and |\endtyl|.
  1150. \par
  1151.  
  1152. The kinds of graphic primitives\index{primitives}\index{capabilities} 
  1153. that \TT knows how to typeset are
  1154. uniform-thickness line segments, uniform-thickness splines,
  1155. uniform-thickness arcs, variable-thickness
  1156. splines, music beams, and music ties/slurs.  Line segments are
  1157. merely a subset of splines, and so variable-thickness lines are available by
  1158. specifying a spline of just two control points with a thickness at one end
  1159. point,\index{primitives, built-up}
  1160.  and another thickness at the other end point. The feature here is to have 
  1161. several primitives available, and allow for other graphic elements
  1162.  to be built using them.\par\filbreak
  1163.  
  1164. We'll look at the basic syntax for the primitives, and then discuss what
  1165. each parameter really means and how to specify what you want.
  1166. The parameters\index{primitives, parameters}\label{parameters} for each 
  1167. of the graphic types are as follows:  literals are
  1168. in a {\btt typewriter} face, any required parameters for the primitive are 
  1169. in \mbox{$\langle$ angle $\rangle$} brackets,
  1170.  and any {\it optional\/} parameters are within 
  1171. \mbox{$\lbrack$ square $\rbrack$}
  1172. brackets. Please note that the relative ordering of the parameters
  1173.  {\it is\/} important, even
  1174. if you do not use any or all optional parameters. Also, it is does not
  1175. matter if you use upper- or lower-case letters for the primitives or markers.
  1176. \par\filbreak
  1177. \medskip
  1178. {\btt\char'134 special\char'173 tyl line}
  1179.  \Opt{measure}
  1180. \Opt{transform} \Prm{thick}\Coma\par
  1181. \hfil \Opt{vector}{\leavevmode\hbox{$\>\lbrack${\btt L}$\>\langle style\rangle\,
  1182. \raise 2.5pt\hbox{\btt ,}\,\rbrack$}} $ x_{\rm left}\,\Coma\>
  1183. y_{\rm bottom}\,\Coma\>
  1184. x_{\rm right}\, \Coma\> y_{\rm top}${\btt\char'175} \par
  1185.  
  1186. \noindent draws a line\index{{\bf line}} segment\index{line segments}
  1187.  from the point $\left( x_{\rm left}\, , \; y_{\rm
  1188. bottom}\right)$ to the point
  1189. $\left( x_{\rm right}\, ,\; y_{\rm top}\right)$ using a line of
  1190. thickness\index{line thickness}
  1191. \Prm{thick}.\par\filbreak
  1192.  
  1193. \medskip
  1194. {\btt\char'134 special\char'173 tyl spline}
  1195.  \Opt{measure}\Opt{transform}\Prm{thick}\Coma\par
  1196. \hfil \Opt{vector}
  1197. {\leavevmode\hbox{$\>\lbrack${\btt L}$\>\langle style\rangle\,
  1198. \raise 2.5pt\hbox{\btt ,}\,\rbrack$}}
  1199. \Opt{s-type}\Opt{closure}\par
  1200. \hfil{\leavevmode\hbox{$\>\lbrack${\btt X}$\>\langle dotsize\rangle\,
  1201. \raise 2.5pt\hbox{\btt ,}\,\rbrack$}}
  1202. \Prm{numpts}\Coma $x_1\, \Coma\> y_1\, \Coma\> \ldots\>\Coma\>
  1203.  x_{\rm numpts}\, \Coma\> y_{\rm numpts}$ {\btt \char'175} \par
  1204.  
  1205. \noindent draws a smooth spline\index{{\bf spline}} curve through the integer points
  1206.  $x_1\, , \; y_1 ,\; \ldots$ \linebreak[4]
  1207.  $\; x_{\rm numpts}\, ,\; y_{\rm numpts}$
  1208. using a line of thickness \Prm{thick}. If the optional {\btt X} marker
  1209. \index{{\tt X}-marker} is specified, dots of diameter \Prm{dotsize} are
  1210. placed to mark the positon of the control points specified. This 
  1211. may be useful for checking your data.\par\filbreak
  1212.  
  1213. \medskip
  1214. {\btt\char'134 special\char'173 tyl ttspline} \Opt{measure}
  1215. \Opt{transform}\par
  1216. \hfil \Opt{vector}\Opt{s-type}\Opt{closure}
  1217. {\leavevmode\hbox{$\>\lbrack${\btt L}$\>\langle style\rangle\,
  1218. \raise 2.5pt\hbox{\btt ,}\,\rbrack$}} \par
  1219. \hfil{\leavevmode\hbox{$\>\lbrack${\btt X}$\>\langle dotsize\rangle\,
  1220. \raise 2.5pt\hbox{\btt ,}\,\rbrack$}}
  1221. \Prm{numpts}\Coma
  1222. $x_1\, \Coma\> y_1\, \Coma\>\ldots\>\Coma\>
  1223. x_{\rm numpts}\,\Coma\> y_{\rm numpts}\,\Coma\>$\par
  1224. \hfil $thick_1\, \Coma\>\ldots\>
  1225. \Coma\> thick_{\rm numpts}$ {\btt \char'175} \par
  1226.  
  1227. \noindent draws a smooth spline through the integer points $x_1 , \; y_1 ,\;
  1228. \ldots$ using a\index{{\bf ttspline}}
  1229. line of varying thickness defined by $thick_i$ at each control point\index{ttspline, thicknesses} 
  1230. $\left( x_i,\; y_i\right)$ (ergo {\underbar t}hick-{\underbar t}hin 
  1231. splines). The {\btt X} marker is also available for marking the positions
  1232. of the specified control points. \par\filbreak
  1233.  
  1234. \medskip
  1235. {\btt\char'134 special\char'173 tyl arc} \Opt{measure}
  1236. \Opt{transform} \Prm{thick}\Coma\par
  1237. \hfil \Opt{vector}
  1238. {\leavevmode\hbox{$\>\lbrack${\btt L}$\>\langle style\rangle\,
  1239. \raise 2.5pt\hbox{\btt ,}\,\rbrack$}}\Prm{radius}\Coma
  1240. {\leavevmode\hbox{$\>\lbrack${\btt @}$\>\langle cent_x\rangle\,
  1241. \raise 2.5pt\hbox{\btt ,}\,\langle cent_y\rangle\, 
  1242. \raise 2.5pt\hbox{\btt ,}\,\rbrack$}}\par
  1243. \hfil\Prm{$angle_1$}\Coma \Prm{$angle_2$}{\btt \char'175} \par
  1244.  
  1245. \noindent draws an arc\index{{\bf arc}} of radius \Prm{arc-radius} going counter-clockwise
  1246. starting from \Prm{$angle_1$} degrees from zero, and \index{arcs, angles}
  1247. finishing at \Prm{$angle_2$} degrees around from zero. If the center point is not specified with 
  1248. the {\btt @} marker\index{{\tt @}-marker}, the arc is assumed to be centered
  1249. at $(0,\, 0)$.\index{arcs, centering}
  1250.  Ellipses\index{ellipses} can be achieved by a simple scaling
  1251.  of a closed arc\index{oval, {\it see} ellipse}
  1252. since scaling and rotational transformations
  1253.  are about the {\it center\/} of the primitive.\par\filbreak
  1254.  
  1255. \medskip
  1256. {\btt\char'134 special\char'173 tyl label} \Opt{measure}
  1257. \Prm{face}\Coma $\;x\, \Coma\> y$\Coma {\btt "}\Prm{string}{\btt "}
  1258. {\btt\char'175}\par
  1259.  
  1260. \noindent places a simple label\index{{\bf label}} at $(x,\, y)$ using
  1261.  a font style\index{labels, font style}\index{labels, face} of 
  1262. \Prm{face} (currently selectable by an integer: e.g.,
  1263.  |1| is amtt10. See page~\pageref{labelfonts} for a better list).
  1264. \Prm{String} is a simple sequence of letters and spaces contained 
  1265. within matching double quotes ({\btt "}).\index{{\tt "}-marker}
  1266. Here, the case of the letters of \Prm{string} is taken  verbatim,
  1267. and it is {\it not}
  1268. interpreted;  {\TeX} macros or typesetting commands are not 
  1269. usable here.\index{labels, strings} If you want to typeset fancier
  1270. labels, \TT is too late in the game.\par\filbreak
  1271.  
  1272. The optional parameter 
  1273. \Prm{measure}\index{measurement}\index{units of measure} is any 
  1274. of {\btt S}\index{{\tt S}-measure},
  1275.  {\btt P}\index{{\tt P}-measure}, 
  1276. or {\btt M}\index{{\tt M}-measure} 
  1277. denoting that the integer
  1278. points, like $x_1,\; y_1,\;\ldots $ are measured in
  1279. scaled-points,\index{scaled points}
  1280. printer's-points\index{printer's points}, or millimeters\index{millimeters}
  1281. respectively. If none is specified, the measurement
  1282. of\index{measurement, default}
  1283. printer's-points is assumed. Just to refresh how big each of those units is:
  1284. \begin{itemize}
  1285. \item there are 72.27 printer's points {\it (pp)\/} per inch
  1286. \item and 65536 scaled-points {\it (sp)\/} per printer's point
  1287. \item and 25.4 millimeters {\it (mm)\/} per inch
  1288. \end{itemize}\par
  1289.   Also remember that the coordinates for the above
  1290. control points (like $x_{left}$ or $x_i$) are in {\it first quadrant} 
  1291. cartesian coordinate-space\index{coordinate space system}. It is useful not to have to remember some
  1292. other coordinate systems, and makes things easier for
  1293. the user and user programs to interact with \TTN, which takes care
  1294. of such details.\par\filbreak
  1295.  
  1296. \Prm{Thick} is the pixel-thickness\index{line thickness}
  1297. \index{pixel thickness} of the vector font\index{vector font} to use. Currently
  1298. the range is from about 1 to 12 pixels thick (we'll talk more about these 
  1299. sizes later). Here are some examples of lines having from 2 to 10 ``pixels''
  1300.  in even thicknesses.\index{line thickness, example}\par
  1301. \noindent\hskip 1in\begintyl{3truecm}[1in]
  1302. \special{tyl beg}
  1303. \special{tyl line m 2 2 4 11 26}
  1304. \special{tyl line m 4 12 23 15 10}
  1305. \special{tyl line m 6 15 20 25 13}
  1306. \special{tyl line m 8 26 9 31 23}
  1307. \special{tyl line m 10 33 2 33 16} 
  1308. \special{tyl end}\endtyl
  1309. \par\filbreak
  1310.  \Prm{Vector} refers to the {\it
  1311. type\/} of vector\index{vector-types}\index{pens} to use,
  1312.  namely {\btt C}\index{{\tt C}-marker} for vectors that look as if they are
  1313.  drawn with a {\it circular\/} ``pen,''\index{circular pen}
  1314.  {\btt H}\index{{\tt H}-marker} for a {\it horizontal\/}
  1315. pen,\index{horizontal pen}
  1316.  and {\btt V}\index{{\tt V}-marker} for 
  1317. {\it vertical\/} pen appearance\index{vertical pen}.
  1318.  A circular pen vector-type is the default\index{vector-types, default}. See also 
  1319. section~\ref{vect-pens} for examples and a better description.\par\filbreak
  1320.  
  1321. \Prm{Style} \index{line style}\index{{\tt L}-marker}is the
  1322.  line-style to use when drawing. Currently, \TT is able to 
  1323. provide solid (style |0|), dotted (style |1|), dashed (|2|), and dot-dashed (|3|)
  1324. line-styles.\index{line style, dotted}\index{line style, dashed}
  1325. \index{line style, solid}\index{line style, dot-dashed} The solid line-style is 
  1326. the default. Here are some simple examples of the styles:\index{line styles, examples}\par
  1327. \begintyl{3truecm}[1in]
  1328. \special{tyl beg}
  1329. \special{tyl line m 2 L 0 (2 4 11 26)}
  1330. \special{tyl line m 2 L 1 (12 23 15 10)}
  1331. \special{tyl line m 2 L 2 (15 20 25 13)}
  1332. \special{tyl line m 2 L 3 (26 9 31 23)}
  1333. \special{tyl end}\endtyl
  1334. \par\filbreak
  1335.  
  1336. \Prm{S-type} is the kind of spline-basis\index{splines, types}\index{splines, basis} 
  1337. to use when interpolating the spline
  1338. through the control points. Currently, {\btt B}\index{{\tt B}-marker}
  1339.  indicates the {\underbar b}-spline basis\index{B-spline basis}
  1340. (which interpolates a spline within the convex hull of the control points),
  1341. {\btt I}\index{{\tt I}-marker} indicates an
  1342.  {\underbar i}nterpolating B-spline\index{interpolating B-spline, basis} (goes through the points
  1343. specified), {\btt D}\index{{\tt D}-marker} for the Cardinal
  1344. basis,\index{Cardinal basis}
  1345. and {\btt K}\index{{\tt K}-marker} which 
  1346. indicates the Catmull-Rom basis\index{Catmull-Rom basis} (which also
  1347.  interpolates a spline {\it through\/} the control points). The
  1348. Catmull basis is the default\index{splines, default basis} spline type in the current 
  1349. implementation.\par\filbreak
  1350.  
  1351. \Prm{Closure}\index{closure}\index{splines, closure} is used to
  1352. indicate whether the spline is a closed \index{closed splines}
  1353. curve (the endpoints overlap), or an open curve\index{open spline} (the
  1354. default)\index{splines, default closure}. We use 
  1355. the iconography of {\btt O}\index{{\tt O}-marker} for a closed curve,
  1356.  and {\btt U}\index{{\tt U}-marker} for an 
  1357. open-ended curve.\par\filbreak
  1358.  
  1359. Now we come to describe what \Prm{transform} is all about. \TT
  1360. allows the user to modify the coordinates of the control points without
  1361. having to re-calculate their new positions by himself.
  1362. \index{design decisions}I tried to make the specification and modification
  1363. of {\it \TeX tyl's\/} primitives as painless and intuitive\index{user intuition} as possible. We
  1364. usually think more in terms of connecting dots and placing graphic elements,
  1365.  and not in terms of slopes, tangents and velocites which are messy at best,
  1366. and get more cumbersome from there.\par\filbreak
  1367.  
  1368. Geometric transforms\index{transformations, {\it see } transforms}
  1369. \index{geometric transforms} like scaling 
  1370. (independently in the $X$ and $Y$ directions), rotating about the ``center''
  1371. of the graphic object (a primitive or a figure), and translating in the $X$ and $Y$ directions are 
  1372. available for most of the primitives. The 
  1373. format\index{{\bf transform}} for specifying some transformation on 
  1374. the currently-specified points\index{transforms, parameters, format}
  1375. is:\par
  1376. \qquad{\btt T}\Coma\Prm{Sx}\Coma\Prm{Sy}\Coma\Prm{Tx}\Coma\Prm{Ty}\Coma\Prm{Rot}\Coma\par
  1377. \noindent where \Prm{Tx} and \Prm{Ty} are translations of the object in
  1378.  the $X$ and $Y$ direction by some signed distance according to the 
  1379. current units of \Prm{measure}. \Prm{Rot} is a signed integer angle (in
  1380. degrees) by which
  1381. to rotate the primitive or figure counter-clockwise about its center.
  1382.   \Prm{Sx} and \Prm{Sy} are\index{transforms, parameters}
  1383. {\it integer\/} scale parameters representing the {\it floating-point\/} values of the 
  1384. transform multiplied by 100 and truncated.
  1385. To obtain any transform, {\it all\/} the transform parameters must be
  1386. specified\index{transforms, parameters, requirement}.\par\filbreak
  1387.  
  1388. Two other special types of graphics capabilities are meant to be utilized 
  1389.  by a
  1390. knowledgeable program, such as the music-typesetting\index{music} system being written at 
  1391. the Ohio State University. These are:\par
  1392. \medskip
  1393. {\btt\char'134 special\char'173 tyl tieslur} \Opt{measure}
  1394.  \Prm{minthick}\Coma \Prm{maxthick}\Coma\par
  1395. \hfil \Prm{numpts}\Coma
  1396. $ x_1\, \Coma\> y_1\, \Coma\>\ldots\>\Coma\>
  1397. x_{\rm numpts}\,\Coma\> y_{\rm numpts}${\btt\char'175}\par
  1398.  
  1399. \noindent which draws a smooth spline curve through the
  1400.  points\index{{\bf tieslur}}\index{slurs}\index{ties}
  1401. $\left(x_i,\;y_i\right)$,
  1402. and uses a built-in algorithm to figure out the correct thicknesses of the
  1403. tie/slur between \Prm{minthick} and \Prm{maxthick}. These control points 
  1404.  are  also in first quadrant cartesian coordinates, and a circular-pen
  1405. vector-type is used to draw the 
  1406. spline.\index{tieslur, pen type}\index{tieslur, thicknesses}\index{tieslur,
  1407. vector type}\par\filbreak
  1408.  
  1409. \medskip
  1410. {\btt\char'134 special\char'173 tyl beam} \Opt{measure} \Prm{staffsize}\Coma
  1411. \Opt{beamtype}\par
  1412. \hfil $x_1\, \Coma\> y_1\, \Coma\> x_2\, \Coma\> y_2${\btt\char'175} \par
  1413.  
  1414. \noindent draws a music beam\index{{\bf beam}} from $\left(x_1,\;y_1\right)$ to
  1415.   $\left(x_2,\;y_2\right)$ (also in first quadrant space)
  1416. using a beam of \Prm{beamtype}\index{beam-types}
  1417.  {\btt G}\index{{\tt G}-marker} for a {\it grace\/}-note sized
  1418. beam,\index{beams, sizes}
  1419.  or {\btt R}\index{{\tt R}-marker}\index{beams, default size} (the default) for 
  1420. {\it regular} sized beams in the specified
  1421. staff-size\index{beams, staff size}.
  1422.  For a description of staff sizes, see \cite{ross}.\par\filbreak
  1423.  
  1424. Finally, there are two more |\special|s that \TT can
  1425. understand. These are used to group any of the above graphic primitives together
  1426. into a ``symbol.''\index{symbol, {\it see} figure}  The commands are:\par
  1427. \medskip
  1428. {\btt\char'134 special\char'173 tyl beginfigure} \Opt{measure} 
  1429. \Opt{transform}\par
  1430. \hfil{\leavevmode\hbox{$\>\lbrack${\btt W}$\>\langle width\/\rangle\,
  1431. \raise 2.5pt\hbox{\btt ,}\,\langle height\rangle\,\rbrack\,$}}
  1432. {\leavevmode\hbox{$\>\lbrack${\btt F}$\>\langle width\/\rangle\,
  1433. \raise 2.5pt\hbox{\btt ,}\,\langle height\rangle\,\rbrack\,$}}
  1434. {\btt\char'175}\par
  1435. \noindent which opens a level of definition\index{{\bf beginfigure}},
  1436. and\par
  1437. \medskip
  1438. {\btt\char'134 special\char'173 tyl endfigure}{\btt\char'175}\par
  1439. \noindent which closes that level of definition\index{{\bf endfigure}}. These are analagous to 
  1440. {\it push} and {\it pop} kinds of operations, with many levels of
  1441. recursive definition available. The optional {\btt F} 
  1442. marker\index{{\tt F}-marker} specifies the final optimal
  1443.  width and height of the figure,\index{figures, fitting to size}
  1444. in terms of units of \Prm{measure}. This is useful for fitting a figure to a
  1445. specific size, so that you do not have to compute the scaling parameters
  1446. by yourself. This ability is often desireable if the figure was created by
  1447. some program that output the figure at a different scaling factor than you
  1448. require on the page. The {\btt W} marker\index{{\tt W}-marker} indicates the
  1449. width and height of the figure at the size that it was originally written,
  1450. which we assume the figure-making program output along with the definition
  1451. of the figure elements.\index{programs making figures}\index{graphic editors}
  1452.  For most
  1453.  practical purposes, you can let \TT\ 
  1454. compute the size of the figure as it was originally created, and then let it
  1455. fit the figure to the sizes requested by the {\btt F} marker.\par
  1456.  
  1457. Besides the implicit transform parameters created by using the {\btt F}
  1458. and/or {\btt W} markers, an explicit figure-level 
  1459. tranformations\index{tranforms, figure-level}\index{figures, tranforms}
  1460. can be specified using the \Prm{transform} capability using units of
  1461. \Prm{measure} (or the default units of printer's
  1462. points).\index{measurement,default}
  1463.  Also, any transforms applied at a level of
  1464. definition are additive\index{transforms, additiveness}
  1465. over the lower-level definitions\index{figure definitions} and any
  1466. transformations that they may have 
  1467. locally\index{figures, transforms}.\par\filbreak
  1468. %\vskip 10pt
  1469. %If this were the {\TeX book}, this paragraph would have three ``dangerous
  1470. %bend'' signs in front. \TT currently has a temporary
  1471. % ability to alter certain internal global
  1472. %variables from the |\special| level. This is meant mostly for debugging,
  1473. %hacking, and generally limited use. You are on your own with these, and
  1474. % I would discourage much use of it (since it may disappear soon).
  1475. % The basic call is\par
  1476. %{\btt\char'134 special\char'173 tyl param} \Prm{param-num} \Prm{value}{\btt\char'175}\par
  1477. %\noindent where \Prm{param-num} is currently one of\index{{\bf param}}
  1478. %\begin{itemize}
  1479. %\item {\tt 1}: for changing the current minimum number of intervals per
  1480. %spline span
  1481. %\item {\tt 2}: for changing the minimum number of intervals per arc
  1482. %spline-span
  1483. %\item {\tt 3}: for debugging the tie/slur clamping mechanism (skip it or not).
  1484. %\end{itemize}
  1485. % and \Prm{value} is the new value. For example,
  1486. %\begin{verbatim}
  1487. %  \special{tyl param 1  4}
  1488. %  \special{tyl param 3 = -1}
  1489. %\end{verbatim}
  1490. %the first sets the minimum number of intervals per spline span to $4$, and the
  1491. %second call says to {\it not\/} skip the clamping mechanism (the |=| sign 
  1492. %is optional, of course). Once these
  1493. %variables are set, they are in effect for the rest of the document, or until
  1494. %changed with a matching |\special{tyl param...| invocation.
  1495. %See later chapters to understand these terms.\par
  1496.  
  1497. \Makeodd
  1498. E_O_F
  1499. else
  1500.   echo "will not over write ./doc/TYLMAN.04"
  1501. fi
  1502. chmod 644 ./doc/TYLMAN.04
  1503. if [ `wc -c ./doc/TYLMAN.04 | awk '{printf $1}'` -ne 18759 ]
  1504. then
  1505. echo `wc -c ./doc/TYLMAN.04 | awk '{print "Got " $1 ", Expected " 18759}'`
  1506. fi
  1507. echo "Finished archive 9 of 9"
  1508. exit
  1509.